package com.jorder.github.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.jorder.github.mapper.TUserMapper;
import com.jorder.github.model.TUser;
import com.jorder.github.service.UserService;

import tk.mybatis.mapper.entity.Example;

@Service("UserSeviceImpl")
public class UserSeviceImpl  implements UserService{
	
	@Autowired
	TUserMapper userMapper;
	
	
	
	@Override
	public PageInfo<TUser> getAll() {
		Page<Object> startPage = PageHelper.startPage(2, 2,false);
		Example example=new Example(TUser.class);
		example.createCriteria().andCondition("1=1");
		List<TUser> selectAll = userMapper.selectByExample(example);
//		redisTemplate.opsForValue().set("123","1",10, TimeUnit.SECONDS);
//		CacheUtils.set("madd", selectAll, new ExpireTime());
		return new PageInfo<>(selectAll);
	}

}
